/**
 * 
 */
package com.edocbase.desktop.plugins.mdairy.part.diary;

import org.eclipse.draw2d.Figure;
import org.eclipse.swt.widgets.Control;

import com.edocbase.desktop.lightweight.widgets.DialogFigure;
import com.edocbase.desktop.lightweight.widgets.FigureOwner;
import com.edocbase.desktop.plugins.driver.mail.MailAccountPopupItem;

/**
 * @author lifei114@gmail.com
 *
 */
public class SelecteAccountDialog extends DialogFigure {

	private MailAccountPopupItem item;
	private boolean showNewAccountOnly = false;
	public SelecteAccountDialog(Control c, Figure parent) {
		super(c, parent);
	}

	@Override
	protected Figure createDialogArea(FigureOwner popupContainer) {
		item = new MailAccountPopupItem();
		if (showNewAccountOnly){
			item.setOwner(popupContainer.getOwner());
			item.showAddAccount();
		}else{
			item.show();
		}
		return item;
		//return null;
	}

	public void setShowNewAccountOnly(boolean showNewAccountOnly) {
		this.showNewAccountOnly = showNewAccountOnly;
	}

	@Override
	protected Object getReturnObject() {
		return item.getSelectedAccounts();
	}



}
